package com.sfjswl.fp.core.flow;

import com.sfjswl.fp.core.context.RuleRoam;
import com.sfjswl.fp.core.leaf.roam.BaseLeafRoamFlow;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class ScoreFlow2 extends BaseLeafRoamFlow {

  private Object value1;
  private Object value2;

  @Override
  protected boolean doRoamFlow(RuleRoam roam) {
    Comparable<Object> value1 = roam.getUnion(this.value1);
    if (value1 == null) {
      return false;
    }
    Comparable<Object> value2 = roam.getUnion(this.value2);
    if (value2 == null) {
      return false;
    }
    return value1.compareTo(value2) >= 0;
  }
}
